package com.multithread.base.impl;

import com.multithread.base.Queue;

/**
 * @author: hfxiang
 * @Description:
 * @date: 2022/8/8 11:03
 */
public class QueueWhile extends Queue {
    public QueueWhile(Integer size) {
        super(size);
    }

    public void purchase() {
        boolean isFirst = true;
        while (isFull()){
            if (isFirst){
                System.out.println("队列满满满满满满满满满满满满了田田田田田田田田田田田田田田田田田田田田");
                isFirst=false;
            }
        }
        putIn();
    }

    public void sale() {
        boolean isFirst = true;
        while (isEmpty()){
            if (isFirst){
                System.out.println("队列空空空空空空空空空空空空了口口口口口口口口口口口口口口口口口口口口");
                isFirst=false;
            }
        }
        putOut();
    }
}
